# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=u3-tool
pkgver=0.3
pkgrel=6
pkgdesc='Tool for controlling USB flash devices that confirm to the U3 specifications.'
url='http://u3-tool.sourceforge.net/'
arch=('x86_64' 'aarch64')
license=('custom')
source=("http://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('b54ac58efa0efce56247cb8c58d60a0598659e9220955aff4edbf2d33589d936077d0068d38eabbbf8192e1905b18cfffc54c1f4927d2b5d3bf252e2639e107c')

build() {
  cd "$pkgname-$pkgver"

  if [[ "$CARCH" == "i686" || "$CARCH" == "x86_64" ]];
  then
    ./configure --prefix=/usr
  else
    ./configure --build=arm --prefix=/usr
  fi

  make
}

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr"

  make install prefix="$pkgdir/usr"

  mv "$pkgdir/usr/sbin" "$pkgdir/usr/bin"
}

